package com.boot.stu.controller;

import com.boot.stu.entity.UserEntity;
import com.boot.stu.service.UserService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author cwt
 */
@RequestMapping("/user")
@RestController
@Api(value = "/user", description = "账号管理Controller")
public class UserController {
    @Autowired
    private UserService service;

    @RequestMapping("/getUser/{id}")
    public HttpEntity<?> getUser(@PathVariable Integer id) {
        return new ResponseEntity<>(service.getUser(id), HttpStatus.OK);
    }

    @RequestMapping("/toWeb")
    public HttpEntity<?> toWeb(@PathVariable Integer id) {
        return new ResponseEntity<>("前后端调联成功", HttpStatus.OK);
    }
}
